﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace emulib
{
    public interface IMmoDatabase
    {
        /// <summary>
        /// Connect to database specified by DatabaseInfo object
        /// </summary>
        /// <param name="dinfo">Object containing necessary info to connect to database</param>
        /// <returns>True on successful connection</returns>
        Boolean Connect(ServerInfo sinfo);
        /// <summary>
        /// Disconnect from connected database
        /// </summary>
        void Disconnect();
        /// <summary>
        /// Perform a selection on database
        /// </summary>
        /// <param name="what">What you are selecting</param>
        /// <param name="from">Where it is being selected from</param>
        /// <param name="where">Limit to selection</param>
        /// <param name="orderBy">What column to be used for ordering</param>
        /// <param name="direction">False: Descending, True: Ascending</param>
        /// <param name="limitStart">Where in the results to start from</param>
        /// <param name="limitMax">How many results to show</param>
        /// <returns>IDataRecord containing results</returns>
        IDataRecord Select(String what, String from, String where = null, String orderBy = null, Boolean direction = false, Int32 limitStart = -1, Int32 limitMax = -1);


    }
}
